package tedu.api.io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class OOSDemo_2 {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("Student2.txt");
        Student zs = new Student();
        zs.setName("张三");
        zs.setAge(18);
        zs.setGender("男");
        zs.setOtherInfo(new String[]{"法外狂徒","罗老师","法外张三"});
        System.out.println(zs);

        fos.write(zs.toString().getBytes(StandardCharsets.UTF_8));
        fos.close();
    }
}
